Fix java tree..(part 2)
[f432xdd.git] / java / Graph Editor / src / app / Main.java
blobdd82445fdd9017c417999cc9b110a3707350c4e7
1 package app;
3 import controllers.*;
4 import models.*;
5 import interfaces.*;
7 public class Main {
8 private GraphModel model;
9 private GraphFrame frame;
11 private boolean twoWindows = false;
12 public Main(String[] args){
13 if(args.length > 0){
14 try{
15 model = GraphModel.fromFile(args[0]);
16 }catch(Exception e){
17 javax.swing.JOptionPane.showMessageDialog(null, "Error reading file!");
18 model = new GraphModel();
20 }else{
21 model = new GraphModel();
24 frame = new GraphFrame(model);
25 new SelectionController(frame, model);
27 if(twoWindows){
28 //Test code voor 2 vensters!
29 GraphFrame frame2 = new GraphFrame(model);
30 new SelectionController(frame2, model);
34 /**
35 * @param args
37 public static void main(String[] args) {
38 new Main(args);